ImageSource

Image source, allows a georeferenced raster image to be shown on the map.

The georeferenced image scales and rotates as the user zooms and rotates the map. The geographic location of the raster image content, supplied with LatLngQuad, can be non-axis aligned.

Constructors

Link copied to clipboard
fun ImageSource(id: String?, coordinates: LatLngQuad?, url: URL)

Create an ImageSource from coordinates and an image URL

Link copied to clipboard
fun ImageSource(id: String?, coordinates: LatLngQuad?, uri: URI)

Create an ImageSource from coordinates and an image URI

Link copied to clipboard
fun ImageSource(id: String?, coordinates: LatLngQuad?, bitmap: Bitmap)

Create an ImageSource from coordinates and a bitmap image

Link copied to clipboard
fun ImageSource(id: String?, coordinates: LatLngQuad?, @DrawableRes resourceId: Int)

Create an ImageSource from coordinates and a bitmap image resource

Functions

Link copied to clipboard

Retrieve the source attribution.

Link copied to clipboard
open fun getId(): String

Retrieve the source id

Link copied to clipboard

Retrieve current maximum overscale factor for parent tiles.

Link copied to clipboard

Retrieve the minimum tile update interval, which is used to throttle the tile update network requests.

Link copied to clipboard

Retrieve current pre-fetching zoom delta.

Link copied to clipboard

Retrieve whether or not the fetched tiles for the given source should be stored in the local cache

Link copied to clipboard
fun setCoordinates(latLngQuad: LatLngQuad?)

Updates the latitude and longitude of the four corners of the image

Link copied to clipboard
open fun setDetached()
Link copied to clipboard
fun setImage(bitmap: Bitmap)

Updates the source image to a bitmap

fun setImage(@DrawableRes resourceId: Int)

Updates the source image to a bitmap image resource

Link copied to clipboard
open fun setMaxOverscaleFactorForParentTiles(@Nullable maxOverscaleFactor: Int?)

When a set of tiles for a current zoom level is being rendered and some of the ideal tiles that cover the screen are not yet loaded, parent tile could be used instead. This might introduce unwanted rendering side-effects, especially for raster tiles that are overscaled multiple times. This method sets the maximum limit for how much a parent tile can be overscaled.

Link copied to clipboard

Sets the minimum tile update interval, which is used to throttle the tile update network requests.

Link copied to clipboard
open fun setPrefetchZoomDelta(@Nullable delta: Int?)

Set the tile pre-fetching zoom delta for current source. Pre-fetching makes sure that a low-resolution tile at the (current_zoom_level - delta) is rendered as soon as possible at the expense of a little bandwidth. If delta has not been set or set to null, it will use the value in MapboxMap instance.

Link copied to clipboard
fun setUri(uri: URI)
fun setUri(uri: String?)

Updates the source image URI.

Link copied to clipboard
fun setUrl(url: URL)
fun setUrl(url: String?)

Updates the source image url

Link copied to clipboard
open fun setVolatile(value: Boolean)

Set a flag defining whether or not the fetched tiles for the given source should be stored in the local cache

Properties

Link copied to clipboard
Link copied to clipboard
val uri: String?

Get the source URI.

Link copied to clipboard
val url: String?